<?php
header('Content-Type: text/html; charset=utf-8');
include('../../includes/classes/core.php');

	$object_id  =  $_REQUEST['id'];
	$money      =  $_REQUEST['money'];
	$res=mysql_fetch_assoc(mysql_query("SELECT      pos_money_action.date AS `date`,
											           persons.`name` AS `person`,
											           object.`name` AS `pos`,
											           pos_money_action.money AS `money`,
											           pos_money_action.`comment` AS `comment`
											FROM       `pos_money_action`
											LEFT JOIN  users ON users.id = pos_money_action.user_id
											LEFT JOIN  persons ON users.person_id = persons.id
											LEFT JOIN  object ON pos_money_action.pos_id = object.id
											WHERE      pos_money_action.pos_id = $object_id AND pos_money_action.action = 3
											ORDER BY   pos_money_action.id DESC 
											LIMIT      1"));
	
												
echo '<p align=center style=" font-size: 15px;"><u>'.$res['date'].'</u></p>';
echo '<p align=center style=" font-size: 15px;">ობიექტი: <u>'.$res['pos'].'</u></p></br>';	

echo '<table  style="width: 100%; "  cellspacing="0" cellpadding="6">
		<tr>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black;">თანხა სალაროში: </td>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black; text-align:right !important;">'. $money .' ლ</td>
		 </tr>
		 <tr>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black;">რეალური თანხა:</td>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black; text-align:right !important;">'.$res['money'].' ლ</td>
		 </tr>
		 <tr>
			<td> &nbsp;</td>
			<td>&nbsp</td>
		 </tr>
		 <tr>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black;">მომხმარებელი:</td>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black; text-align:right !important;">'.$res['person'].'</td>
		 </tr>
		 <tr>
			<td>&nbsp</td>
			<td>&nbsp</td>		
		 </tr>
		 <tr>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black;">კომენტარი:</td>
			<td style="font-size: 20px; width: 35%; border-bottom:1px solid black; text-align:right !important;">'.$res['comment'].'</td>
		 </tr>
	</table>';
	
	
	